$(document).ready(function(){
	var validator = $("#frmAddBudget").validate({
		
		errorElement:'div',
		rules: {
			budgetname: {
				required: true,
				number:true,
				remote:SITEROOT+'/admin/budget/checkbudgetexist.php'
			},	
			budgetfrom: {
				required: true,
				number:true
			},
			budgetto: {
				required: true,
				number:true
			}				
		},
		messages: {
			budgetname: {
				required: "Please enter budget name ",
				number: "Please enter numbers only",
				remote: jQuery.format("Budget name already in use")
			},
			budgetfrom: {
				required: "Enter from value",
				number: "Please enter numbers only"
			},
			budgetto: {
				required: "Enter to value",
				number: "Please enter numbers only"
			}
		}	
		});	
	
	var validator = $("#frmEditBudget").validate({
		
		errorElement:'div',
		rules: {
			budgetname: {
				required: true,
				number:true,
				remote:SITEROOT+'/admin/budget/checkbudgetexist.php?id='+$("#budgetId").val()
			},	
			budgetfrom: {
				required: true,
				number:true
			},
			budgetto: {
				required: true,
				number:true
			}			
		},
		messages: {
			budgetname: {
				required: "Please enter budget name",
				number: "Please enter numbers only",
				remote: jQuery.format("Budget name already in use")
			},
			budgetfrom: {
				required: "Enter from value",
				number: "Please enter numbers only"
			},
			budgetto: {
				required: "Enter to value",
				number: "Please enter numbers only"
			}
		}
	
		});
	
	
});